8 //criba[i] = false si i es primo
12 memset(criba
, false, sizeof(criba
));
14 criba
[0] = criba
[1] = true;
15 for (int i
=2; i
<=SIZE
; i
+= 2){
19 for (int i
=3; i
<=SIZE
; i
+= 2){
21 for (int j
=i
+i
; j
<=SIZE
; j
+= i
){
28 int main(int argc
, char const *argv
){
33 for (int i
=3; i
<=SIZE
; i
+=2){
39 //cout << "primes.size() " << primes.size() << endl;
40 //cout << "Last: " << primes.back() << endl;
42 while (cin
>> n
>> c
){
44 while (end
< primes
.size() && primes
[end
] <= n
){
48 //La lista termina en end, inclu铆do. Tiene end+1 elementos.
49 //cout << primes[end] << endl;
50 int a
, b
; //imprimir desde primes[a] hasta primes[b]
51 if ((end
+1)%2 == 0){ //tiene cantidad par de elementos
52 //cout << "Cantidad par" << endl;
57 }else{ //tiene cantidad impar
58 //cout << "Cantidad impar" << endl;
59 a
= (end
+1)/2 - (c
-1);
61 b
= (end
+1)/2 + (c
-1);
65 cout
<< n
<< " " << c
<< ":";
66 for (int i
=a
; i
<=b
; ++i
){
67 cout
<< " " << primes
[i
];